kernel-selftest: add libcap to build and runtime dependencies
PATCH 1/2 kernel-selftest: add libcap to build and runtime dependencies
libcap is needed unconditionally for capability-aware tests such as breakpoints, cgroup, clone3, futex, ptrace, and seccomp. Add it to DEPENDS so it is always available at build time and to RDEPENDS so the installed tests can call cap_get_proc() and friends at runtime.
bash and libgcc are also added to RDEPENDS: bash is required by several test shell scripts, and libgcc provides libgcc_s.so needed by tests that use GCC-emitted unwinding stubs.
--- meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +2 -2
@@ -4,7 +4,7 @@ LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" -DEPENDS = "rsync-native llvm-native" +DEPENDS = "rsync-native llvm-native libcap" S = "${UNPACKDIR}"
@@ -161,7 +161,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" INHIBIT_PACKAGE_DEBUG_SPLIT = "1" FILES:${PN} += "/usr/kernel-selftest" -RDEPENDS:${PN} += "python3 perl perl-module-io-handle" +RDEPENDS:${PN} += "python3 perl perl-module-io-handle bash libcap libgcc" INSANE_SKIP:${PN} += "libdir"
Signature · 1 line
2.34.1
PATCH 2/2 kernel-selftest: add generic architecture-independent self-tests
Add generic kernel self-tests that build cleanly with mainline kernel (6.18+), work on all architectures, and either PASS or SKIP gracefully at runtime.
Tests added:
- acct: BSD process accounting
- breakpoints: hardware breakpoint handling
- cachestat: page cache statistics (cachestat syscall)
- cgroup: control group v1 interface
- clone3: clone3 syscall with flags
- core: syscalls like close_range, unshare
- coredump: core dump generation
- dmabuf-heaps: DMA-BUF heap allocator
- efivarfs: EFI variable filesystem
- filelock: POSIX file locking (OFD locks)
- filesystems: basic filesystem operations
- filesystems/binderfs: Android Binder IPC (skips if CONFIG_ANDROID_BINDERFS=n)
- filesystems/epoll: epoll syscall extensions
- fpu: floating-point unit state
- ftrace: function tracer interface
- futex: fast userspace mutex
- gpio: general purpose I/O
- ipc: System V IPC primitives
- kcmp: compare kernel resource identifiers
- kvm: kernel-based virtual machine
- landlock: LSM sandboxing (skips if CONFIG_SECURITY_LANDLOCK=n)
- locking: ww_mutex deadlock avoidance
- lsm: Linux Security Module interface
- membarrier: memory barrier syscalls
- mincore: mincore syscall (page residency)
- mount: mount syscall (unprivileged variants)
- mount_setattr: mount attribute syscall
- move_mount_set_group: move_mount peer group
- mseal_system_mappings: system mapping sealing
- namespaces: PID/UTS/IPC/mount/network namespaces
- net: networking stack
- net/mptcp: multipath TCP
- pidfd: pidfd-based process management
- pid_namespace: PID namespace limits
- proc: /proc filesystem interface
- ptrace: process tracing
- rlimits: resource limits
- rseq: restartable sequences
- sched: scheduler and real-time classes
- seccomp: secure computing mode
- signal: signal handling
- size: ELF size utilities
- splice: zero-copy data transfers
- sync: cache synchronization
- syscall_user_dispatch: user-space syscall dispatch
- sysctl: sysctl interface
- tc-testing: traffic control
- timens: time namespaces
- tmpfs: tmpfs filesystem
- tpm2: Trusted Platform Module 2.0
- tty: TTY layer
- uevent: kernel uevent subsystem
- user_events: tracepoint user interface
- vDSO: virtual dynamic shared object
- watchdog: hardware watchdog timer
- zram: compressed RAM block device
Tested on aarch64 device BeaglePlay(AM6254 SoC):
- Tests either PASS or SKIP gracefully
Depends-on: kernel-selftest: add libcap to build and runtime dependencies
--- .../kernel-selftest/kernel-selftest.bb | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +57 -1
@@ -51,11 +51,67 @@ DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" TEST_LIST = "\ ${@bb.utils.filter('PACKAGECONFIG', 'bpf firmware mm', d)} \ + acct \ + breakpoints \ + cachestat \ + cgroup \ + clone3 \ + core \ + coredump \ cpufreq \ cpu-hotplug \ - rtc \ + dmabuf-heaps \ + efivarfs \ + filelock \ + filesystems \ + filesystems/binderfs \ + filesystems/epoll \ + fpu \ + ftrace \ + futex \ + gpio \ + ipc \ + kcmp \ + kvm \ + landlock \ + locking \ + lsm \ + membarrier \ + mincore \ + mount \ + mount_setattr \ + move_mount_set_group \ + mseal_system_mappings \ + namespaces \ + net \ + net/mptcp \ + pidfd \ + pid_namespace \ + proc \ + ptrace \ ptp \ + rlimits \ + rseq \ + rtc \ + sched \ + seccomp \ + signal \ + size \ + splice \ + sync \ + syscall_user_dispatch \ + sysctl \ + tc-testing \ + timens \ timers \ + tmpfs \ + tpm2 \ + tty \ + uevent \ + user_events \ + vDSO \ + watchdog \ + zram \ " EXTRA_OEMAKE = '\ CROSS_COMPILE=${TARGET_PREFIX} \
Signature · 1 line
2.34.1
Hi, Thanks for accepting this patch series in master branch[0][1]. But it is not backported into wrynose yet. As per release notes[2], wrynose is based on linux kernel 6.18 and these patches adds kernel-selftests upto the tests added till 6.18 kernel.
Can we backport these to wrynose as well ? Let me know if there are any concerns.
[0]: https://git.openembedded.org/meta-openembedded/commit/?id=447405d1ff7db1478e7d5db5dda7eb0545d5520b
[1]: https://git.openembedded.org/meta-openembedded/commit/?id=d56e22f0d68cf99b052793c80fd9509677e89cea
[2]: https://docs.yoctoproject.org/6.0/migration-guides/release-notes-6.0.html#new-features-enhancements-in-yocto-ver
- Jeevan
Quoted 41 lines · Jeevan
libcap is needed unconditionally for capability-aware tests such as breakpoints, cgroup, clone3, futex, ptrace, and seccomp. Add it to DEPENDS so it is always available at build time and to RDEPENDS so the installed tests can call
cap_get_proc()and friends at runtime.bash and libgcc are also added to RDEPENDS: bash is required by several test shell scripts, and libgcc provides libgcc_s.so needed by tests that use GCC-emitted unwinding stubs.
Signed-off-by Telukula Jeevan Kumar Sahu <[email protected]>---
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +0
-0@@ -4,7 +4,7 @@ LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM= "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +1
-1-DEPENDS = "rsync-native llvm-native" +DEPENDS = "rsync-native llvm-native libcap"S = "${UNPACKDIR}"
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +0
-0@@ -161,7 +161,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
INHIBIT_PACKAGE_DEBUG_SPLIT= "1"
FILES:${PN} += "/usr/kernel-selftest"meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +1
-1-RDEPENDS:${PN} += "python3 perl perl-module-io-handle" +RDEPENDS:${PN} += "python3 perl perl-module-io-handle bash libcap libgcc"INSANE_SKIP:${PN} += "libdir"
--
2.34.1